import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import*
testCase="DBshop007_销售管理查看发货单流程"

# 1.点击销售管理发货单。
firefox=openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu2(firefox,"销售管理","发货单")
# 2.点击“查看”按钮，可以查看发货单已发货和未发货信息。
rootPath=get_pro_rootpath() #获取项目的绝对路径
orderID=readFile(rootPath+r'\public\order001.txt') #拼接文件路径
firefox.find_element_by_xpath("//td[text()='%s']/following-sibling::td[5]/a"%orderID).click()
#断言

str1 = "已收货"
str2=firefox.find_element_by_xpath("//strong").text
l="订单号"+orderID+"  "
r="\)"
str3=reGetString(str2,l,r)
print(str3)
if str3==str1:
    writeLog("%s 测试通过"%testCase)
else:
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
firefox.quit()